

#import <Foundation/Foundation.h>
#import "ServerCommunicationProtocol.h"
#import "NetworkEngine.h"
#import "NetworkRequest.h"
#import "RequestIDGenerator.h"
#import "RequestUrlBook.h"


@interface ServerCommunicationManager : NSObject <ServerCommunicationProtocol,NetworkEngineDelegate>
{
    NSDictionary *_protocolList;
    NSString* _cookieDomain;
}
@property (nonatomic,retain) RequestIDGenerator* idGenerator;
@property (nonatomic,retain) RequestUrlBook* urlBook;
@property (nonatomic,retain) NetworkEngine* networkEngine;
@property (nonatomic,retain) NSMutableArray* sendRequestInfoArray;

+ (id<ServerCommunicationProtocol>) GetServerCommunication;
- (BaseRequest*)findSendRequestInfoById:(NSUInteger)rid;
- (BaseRequest*)findSendRequestInfoByRequest:(NetworkRequest*)req;
- (void)removeSendRequestInfo:(BaseRequest*)info;
-(BaseResponse*) responseFromRequest:(BaseRequest*)request  ResponseData:(NSData*)responseData;
-(BaseResponse*) responseForFuncionName:(NSString*)function;

// 动态切环境时，需要重置数据
- (void)resetUrlBookAndCookieDomain;
- (void)setUrlBookAndCookieDomain;
@end
